package q10.unittests;

import junit.framework.TestCase;
import q10.Functii.FunctiiElementare.*;
import q10.Operatori.*;
import q10.Arbori.*;

public class PlusTest extends TestCase {
	
	Nod n;
	Nod nec1=new Necunoscuta();
	Nod nec2=new Necunoscuta();

	protected void setUp() throws Exception {
		n=new Plus();
		n.setfDrept(nec1);
		n.setfStang(nec2);
	}

	protected void tearDown() throws Exception {
		n=null;
	}

	public void testDerivare() {
		String rez=this.n.getfDrept().derivare()+"+"+this.n.getfStang().derivare();
		assertEquals(rez,this.n.derivare());
	}

	public void testCalculDerivata() {
		double rez=this.n.getfDrept().calculDerivata()+this.n.getfStang().calculDerivata();
		assertEquals(rez,this.n.calculDerivata());
	}


	public void testCalcul() {
		double rez=n.getfDrept().calcul()+n.getfStang().calcul();
		assertEquals(rez,this.n.calcul());
	}

	public void testConcatTermens() {
		String rez=this.n.getfDrept().derivare()+"+"+this.n.getfStang().derivare();
		assertEquals(rez,this.n.derivare());
	}

}
